package com.cskaoyan.service.promote;

import com.cskaoyan.mapper.MallFootprintMapper;
import com.cskaoyan.model.vo.promote_ad.BaseData;
import com.cskaoyan.model.vo.promote_ad.WxFootprintVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 微信/足迹
 * @author：23117
 * @date: 2021/12/4
 */
@Service
public class WxFootprintServiceImpl implements WxFootprintService {
    @Autowired
    MallFootprintMapper mallFootprintMapper;

    @Override
    public BaseData list(Integer page, Integer limit,Integer userId) {
        PageHelper.startPage(page,limit);



        List<WxFootprintVo> wxFootprintVos = mallFootprintMapper.selectConect(userId);

        PageInfo info = new PageInfo(wxFootprintVos);
        int total = (int) info.getTotal();
        BaseData data = new BaseData(total,wxFootprintVos);


        return data;
    }
}
